//
//  EFGoodDetailViewCellGuessLike.m
//  EnjogFood
//
//  Created by guocheng on 2017/5/27.
//  Copyright © 2017年 wf. All rights reserved.
//

#import "EFGoodDetailViewCellGuessLike.h"
#import "EFGoodDetailViewItemGuessLike.h"
#import "EFBigSaleView.h"


@interface EFGoodDetailViewCellGuessLike()

@property(strong,nonatomic)EFBigSaleView* leftBigSaleView;
@property(strong,nonatomic)EFBigSaleView* rightBigSaleView;

@end

@implementation EFGoodDetailViewCellGuessLike



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = [UIColor whiteColor];
        self.backgroundColor = [UIColor whiteColor];
        [self initView];
    }
    return self;
}

-(void)setObject:(EFGoodDetailViewItemGuessLike *)item{
    [self.leftBigSaleView refreshUI:item.leftItem];
    if (item.rightItem != NULL) {
        [self.rightBigSaleView setHidden:NO];
        [self.rightBigSaleView refreshUI:item.rightItem];
    }else{
        [self.rightBigSaleView setHidden:YES];
    }
}

-(void)initView{
    [self.contentView addSubview:self.leftBigSaleView];
    [self.contentView addSubview:self.rightBigSaleView];
}


-(EFBigSaleView *)leftBigSaleView{
    if(_leftBigSaleView == NULL){
        _leftBigSaleView = [[EFBigSaleView alloc]initWithFrame:CGRectMake(0, 0, 165, 252)];
        _leftBigSaleView.left = 20;
        _leftBigSaleView.top = 10;
    }
    return _leftBigSaleView;
}

-(EFBigSaleView *)rightBigSaleView{
    if(_rightBigSaleView == NULL){
        _rightBigSaleView = [[EFBigSaleView alloc]initWithFrame:CGRectMake(0, 0, 165, 252)];
        _rightBigSaleView.left = kScreenWidth - _rightBigSaleView.width - 20;
        _rightBigSaleView.top = 10;
    }
    return _rightBigSaleView;
}

@end
